package ecmnext.net;


/***************************************************************/
/*                     SOFTWARE SECTION                        */
/***************************************************************/
/*
 * <p>Name: ECMNext</p>
 * <p>Description: Simulation of the platform of trading Software</p>
 * <p>Licence: General Public License</p>
 * <p>Organisation: EC Marseille</p>
 * <p>Persons involved in the project : groupe Plateforme de Trading</p>
 * <p>Current version: 1.0</p>
 */


/***************************************************************/
/*                       IMPORT SECTION                        */
/***************************************************************/

import org.jdom.*;

/***************************************************************/
/*                WarnForClient CLASS SECTION                  */
/***************************************************************/
/**
 * <p>Title : WarnForClient class</p>
 * <p>Description : This class is used by the researcher to send piece of information
 * to the client about the market. It can be uncertain information (e.g. rise or fall
 * of prices).</p>
 * @author Xuewen YANG ET Antoine COUDERC
 * @version 1.0
 */

public class WarnForClient implements NetworkWritable, NetworkReadable{


  private String warn;

  public String getWarn() {
    return this.warn;
  }

  public WarnForClient(String message) {
    this.warn = message;
  }

  public boolean initFromNetworkInput(Element node) {
    if (!node.getName().equals("Warn")) return false;
    this.warn = node.getText();
    return true;
  }

  public Element prepareForNetworkOutput(String pt) {
    Element node = new Element("Warn");
    return node.setText(this.warn);
  }

}
